package com.wechat.entity;

import com.swak.App;
import com.swak.annotation.Table;
import com.swak.persistence.BaseMapper;
import com.swak.persistence.Model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 描述
 * 
 * @author Auto Generator
 * @date 2023-02-01T11:00:34.909152200
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value="WECHAT_CONTACT", useMerge = true)
public class Contact extends Model<Contact, String> {
	
	@lombok.EqualsAndHashCode.Exclude
	@lombok.ToString.Exclude
	private static volatile transient BaseMapper<Contact, String> _mapper;
	
	public static final String Id = "ID";
	public static final String Type = "TYPE";
	public static final String NickName = "NICK_NAME";
	public static final String Alias = "ALIAS";
	public static final String PyInitial = "PY_INITIAL";
	public static final String PyName = "PY_NAME";
	public static final String PyAlias = "PY_ALIAS";
	public static final String Remarks = "REMARKS";
	public static final String Sign = "SIGN";
	public static final String Sex = "SEX";
	public static final String Office = "OFFICE";
	public static final String IsFriend = "IS_FRIEND";
	public static final String IsStar = "IS_STAR";
	public static final String SrcType = "SRC_TYPE";
	public static final String SrcId = "SRC_ID";
	public static final String SrcName = "SRC_NAME";
	public static final String AddDate = "ADD_DATE";
	public static final String AddRemarks = "ADD_REMARKS";
	public static final String VerifyFlag = "VERIFY_FLAG";
	public static final String CreateDate = "CREATE_DATE";
	public static final String UpdateDate = "UPDATE_DATE";
	public static final String DelFlag = "DEL_FLAG";
	public static final String DelAt = "DEL_AT";
	
	private Byte type;
	private String nickName;
	private String alias;
	private String pyInitial;
	private String pyName;
	private String pyAlias;
	private String remarks;
	private String sign;
	private Byte sex;
	private String office;
	private Byte isFriend;
	private Byte isStar;
	private Byte srcType;
	private String srcId;
	private String srcName;
	private java.time.LocalDateTime addDate;
	private String addRemarks;
	private Integer verifyFlag;
	
	@Override
	public String prePersist() {
		return this.initDates();
	}
	
	@Override
	@SuppressWarnings("unchecked")
	protected BaseMapper<Contact, String> getSqlRunner() {
		if (_mapper == null) {
			synchronized (Contact.class) {
				if (_mapper == null) {
					_mapper = (BaseMapper<Contact, String>) App.getBean(getTableDefine().getMapper());
				}
			}
		}
		return _mapper;
	}
	
	public static Contact of() {
	    return new Contact();
	}
}
